package cn.ekuma.util;

import java.util.HashMap;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;

public class JsonUtil {

	public static String toString(HashMap obj){
		return JSON.toJSONString(obj); 
	}
	
	
	public static HashMap getHashMap(String jsonString){
		if(jsonString==null||jsonString.isEmpty())
			return new HashMap();
		HashMap retMap;
		try{
			retMap=JSON.parseObject(jsonString, HashMap.class);
		}catch(JSONException e){
			e.printStackTrace();
			return new HashMap();
		}
		return retMap; 
	}
}
